projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2cabfcc
)
cssselector: Don't invoke undefined behavior
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 26 Feb 2016 19:48:21 +0000
(14:48 -0500)
committer
Matthias Clasen
<mclasen@redhat.com>
Fri, 26 Feb 2016 20:52:19 +0000
(15:52 -0500)
Avoid undefined behavior in the calculation of some
hash values. Found by gcc's undefined behavior sanitizer.
gtk/gtkcssselector.c
patch
|
blob
|
history
diff --git
a/gtk/gtkcssselector.c
b/gtk/gtkcssselector.c
index f0e91b2a5cf059fe972d6823faea3b5f436a9605..9309de5d6fd59542cef74c5267e47ec32428bb97 100644
(file)
--- a/
gtk/gtkcssselector.c
+++ b/
gtk/gtkcssselector.c
@@
-842,7
+842,7
@@
match_pseudoclass_position (const GtkCssSelector *selector,
static guint
hash_pseudoclass_position (const GtkCssSelector *a)
{
- return (
((a->position.type
<< POSITION_NUMBER_BITS) | a->position.a) << POSITION_NUMBER_BITS) | a->position.b;
+ return (
guint)(((((gulong)a->position.type)
<< POSITION_NUMBER_BITS) | a->position.a) << POSITION_NUMBER_BITS) | a->position.b;
}
static int